package com.ee.chat.admin.controller2.datastatis;

import com.ee.chat.admin.service2.IImAnalysisService;
import com.ee.chat.common.bean.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author AppiJ
 * @Date 2020/12/3 14:57
 */
@RestController
@RequestMapping("dataStatis/imAnalysis")
public class ImAnalysisController {
    private Logger log = LoggerFactory.getLogger(ImAnalysisController.class);

    @Resource
    IImAnalysisService imAnalysisService;

    /**
     * 获取消息分析列表
     * @Author AppiJ
     * @Date 2020/12/3 14:58
     * @param
     * @return
     */
    @RequestMapping("list")
    public Result list(HttpServletRequest request, Integer userId, Integer host, String field, String sort, String dateTime,
                       @RequestParam Integer page, @RequestParam Integer limit){
        try {
            return imAnalysisService.list(request, userId, host, field, sort, dateTime, page, limit);
        } catch (Exception e){
            log.error("【查询消息分析列表错误】", e);
        }
        return Result.returnFailure();
    }
}
